<?php

	class RegExp {

		static $instance = NULL;
    
	    static function getInstance(){
	        if(self::$instance == NULL){
	            self::$instance = new RegExp();
	        }
	        
	        return self::$instance;
	    }

	    /**
	     * 匹配小写字母,两侧各有且只有三个大写字母
	     * @param  [string] $string
	     * @return [array]  
	     */
	    function threeCap($string){

	    	$pattern = "/[a-z][A-Z]{3}([a-z])[A-Z]{3}[a-z]/";
	    	preg_match_all($pattern, $string, $outPut);
	    	$matches = array();
	    	if(!empty($outPut[1])){
				foreach ($outPut[1] as $value) {
					$matches[] = $value;
				}
	    	}
	        return $matches;
	    }

	}